/**
 * @file Path.h
 * @author BadFatCat0919 (543015378@qq.com)
 * @brief 路径类
 */

#ifndef __PATH_H__
#define __PATH_H__

#include "def.h"
#include "Map.h"
#include "Robot.h"
#include "Bench.h"
#include "Cmd.h"
#include <list>

class Path {
private:
    static int robotRegion[ROBOT_NUM_MAX]; // 机器人所在区域
    static int benchRegion[BENCH_NUM_MAX]; // 工作台所在区域
    static int benchRegionFull[BENCH_NUM_MAX]; // 满载地图下工作台所在区域
    static std::list<Cmd> cmdSeqEmpty[BENCH_NUM_MAX][BENCH_NUM_MAX]; // 在工作台间空载移动的指令序列
    static std::list<Cmd> cmdSeqFull[BENCH_NUM_MAX][BENCH_NUM_MAX]; // 在工作台间满载移动的指令序列
    static bool hadCmdSeqEmpty[BENCH_NUM_MAX][BENCH_NUM_MAX]; // 已经计算过在工作台间空载移动的指令序列
    static bool hadCmdSeqFull[BENCH_NUM_MAX][BENCH_NUM_MAX]; // 已经计算过在工作台间满载移动的指令序列

public:
    static void initEmptyRegion();
    static void initFullRegion();
    static void init();
    static bool isArrival_BenchToBench(int start, int end, bool isEmpty);
    static bool isArrival_RobotToBench(int robot, int bench);
    static std::list<Cmd> getCmdSeq_BenchToBench(int StartBench, int EndBench, bool isEmpty);
    static std::list<Cmd> getCmdSeq_RobotToBench(int robot, int bench, bool isEmpty);
    static std::list<Cmd> getCmdSeq(Robot *robot, Bench *buy, Bench *sell);
    static int getDistance_BenchToBench(int StartBench, int EndBench, bool isEmpty);
    static int getDistance_RobotToBench(int robot, int bench);
};

#endif // __PATH_H__
